<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
		<!-- 视口 -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<!-- 引入的相关文件 -->
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/login.css" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.3.1.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
	</head>
	<body>
		
		<!-- 栅格系统 -->
		<div class="container-fluid">
			
			<!-- 头部导航栏 -->
			<div class="row navbarr" >
				<div class="col-md-6 col-md-offset-3 col-sm-6 col-sm-offset-3 topnav" >
					<div class="topnavl">
						<a href="#">〈  &nbsp;主页</a>
					</div>
					<div class="topnavr" >
						<a href="#" onclick="esc()" >退出</a>
					</div>
				</div>
			</div>
			
			<!-- 注册 -->
			<div class="row landrow" >
				<div class="col-md-2 col-md-offset-7 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 landdiv" >
					<form action="${pageContext.request.contextPath }/addUser.action" method="GET"
						onsubmit="return check()" >
						<div class="form-group">
							<label>
								用户名：<span  class="msg" > ${msg} </span>
							</label>
							<input id="username" name="username" type="text" class="form-control"/>
						</div>
						<div class="form-group">
							<label>
								密&emsp;码：
							</label>
							<input id="password" name="password" type="password" class="form-control"/>
						</div>
						<div class="form-group btndiv">
							<input type="submit" class="btn btn-success" value="注册" />
						</div>
					</form>
				</div>
			</div>
		</div>
		<script>
			// 判断是登录账号和密码是否为空
			function check(){
			    var usercode = $("#username").val();
			    var password = $("#password").val();
			    if(username=="" || password==""){
			    	$(".msg").text("账号或密码不能为空！");
			        return false;
			    }  
			    return true;
			}
			function esc(){
				window.location.href="tologin";
			}
		</script>
	</body>
</html>
